package thread;

public class CurrentThreadDemo {
    public static void main(String[] args) {
        Thread main =Thread.currentThread();
        System.out.println(main);
        showThreadInfo();
    }
    public static void showThreadInfo(){
        Thread t = Thread.currentThread();
        System.out.println("执行" + t);
        String name = t.getName();
        System.out.println("名字" + name);
        long id = t.getId();
        System.out.println("id" + id);
        int priority = t.getPriority();
        System.out.println("线程是" + priority);
        Boolean i1 = t.isAlive();
        Boolean i2 = t.isDaemon();
        Boolean i3 = t.isInterrupted();
        System.out.println("线程是否活着" + i1);
        System.out.println("是否为守护线程" + i2);
        System.out.println("线程是否中断" + i3);
    }
}
